import { createRouter, createWebHistory } from 'vue-router'

// 2. 定义一些路由
const routes = [
    {
        path: '/home',
        name: 'home',
        component: () => import("@/views/Home.vue"),
        //useFrame 是自己定义的一个变量 为了表示是否是全屏展示 false 是全屏 true不是全屏
        meta: { title: "首页", show: true, icon:'House',useFrame:true}
    },
    {
        path: '/',
        name: 'moveshow',
        component: () => import("@/views/Moveshow.vue"),
        meta: { title: "首页", show: false, icon: 'HomeFilled', useFrame: false }
    },
    {
        path: '/moveShopDetail',
        name: 'moveShopDetail',
        component: () => import("@/views/MoveShopDetail.vue"),
        meta: { title: "商品详情页", show: false, icon: 'HomeFilled', useFrame: false }
    },
    {
        path: '/moveShopfl',
        name: 'moveShopfl',
        component: () => import("@/views/MoveShopFl.vue"),
        meta: { title: "商品分类", show: false, icon: 'HomeFilled', useFrame: false }
    },
    {
        path: '/moveProductList',
        name: 'moveProductList',
        component: () => import("@/views/MoveProductList.vue"),
        meta: { title: "商品列表", show: false, icon: 'HomeFilled', useFrame: false }
    },
    {
        path: '/product',
        component: () => import("@/views/product/Index.vue"),
        meta: { title: "商品管理", show: true, icon: 'Handbag'},
        children: [
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import("@/views/product/Add.vue"),
                meta: { title: "商品添加", show: true, icon: 'Plus' },
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import("@/views/product/Edit.vue"),
                meta: { title: "商品修改", show: false, icon: 'Edit' },
            },
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import("@/views/product/List.vue"),
                meta: { title: "商品列表", show: true, icon: 'List' },
            },
        ]
    },
    {
        path: '/category',
        component: () => import("@/views/category/Index.vue"),
        meta: { title: "类目管理", show: true, icon: 'Grid' },
        children: [
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import("@/views/category/Add.vue"),
                meta: { title: "类目添加", show: true, icon: 'Plus' },
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import("@/views/category/Edit.vue"),
                meta: { title: "类目修改", show: false, icon: 'Edit' },
            },
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import("@/views/category/List.vue"),
                meta: { title: "类目列表", show: true, icon: 'List' },
            },
        ]
    }
    
]
// 3. 创建路由实例并传递 `routes` 配置
const router = createRouter({
   
    history: createWebHistory(),
    routes, // `routes: routes` 的缩写
})
//导出路由
export default router